package com.reader.core.exception;

import com.reader.core.entity.ResultMessageInfo;

/**

 * 自定义异常
 * @author jiahaikun
 * @date 2018-07-26
 */
public class CustomException extends RuntimeException {

    private Object data;
    private Integer code;
    private String msg;

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public Object getData() {
        return data;
    }

    public CustomException(Integer code) {
        this.code=code;
    }
    public CustomException(String msg) {
        this.code=ResultMessageInfo.State.FAILED.getCode();//如果不传code 则用统一code
        this.msg=msg;
    }
    public CustomException(Integer code,String msg) {
        this.code=code;
        this.msg=msg;
    }
    public CustomException(Integer code,String msg,Object data) {
        this.code=code;
        this.msg=msg;
        this.data=data;
    }

}
